#include <iostream>
#include <cstdio>
using namespace std;

int main()
{
    for (int k=123; k<333; ++k)
    {
        int abc = k, def = 2*k, ghi = 3*k;
        int a, b, c, d, e, f, g, h, i;
        a = abc/100; d = def/100; g = ghi / 100;
        b = (abc-100*a)/10; e = (def-100*d)/10; h = (ghi-100*g)/10;
        c = abc%10; f = def %10; i = ghi %10;

        int ten[11] = {0};
        ++ten[a];++ten[b];++ten[c];
        ++ten[d];++ten[e];++ten[f];
        ++ten[g];++ten[h];++ten[i];
        for (int j=1; j<=9; ++j)
            if(ten[j]!=1) goto next;

        printf("%d %d %d\n", abc, def, ghi);
        next:;
    }
    return 0;
}
